-
Notifications
You must be signed in to change notification settings - Fork 39
refact cuda ut to facilitate automation #559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: n1ck-guo <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: Sun, Xuehao <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: Sun, Xuehao <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
auto_round/data_type/int.py
Outdated
@@ -134,10 +134,13 @@ def quant_tensor_sym_dq( | |||
|
|||
scale = scale.view(-1, 1) | |||
zp = torch.full_like(scale, maxq) # pylint: disable=E1130 | |||
scale = torch.where(scale < 0, torch.clamp(scale, max=-q_scale_thresh), torch.clamp(scale, min=q_scale_thresh)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using full-range symmetric quantization here? As I mentioned earlier, it may not be well-suited for double quantization. Do you have any accuracy data to support this choice?
auto_round/data_type/int.py
Outdated
int_w = round_ste(tensor / scale + v) | ||
q = torch.clamp(int_w + zp, 0, 2 ** bits - 1) | ||
qdq_result = (scale * (q - zp)).to(tensor.dtype) | ||
qdq_result = revert_tensor_by_pad(qdq_result, orig_shape=orig_shape, pad_len=pad_len) | ||
if qdq_result.isnan().sum() > 0: | ||
breakpoint() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted later
Signed-off-by: n1ck-guo <[email protected]>
No description provided.